<#noparse><?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd"></#noparse>
<mapper namespace="${packageName}.dao.${entry.entityName?cap_first}Dao">
  <resultMap id="BaseResultMap" type="${packageName}.entity.po.${entry.entityName?cap_first}PO">
      <#list entry["javaFieldInfos"] as field>
        <id column="${field.columnName?uncap_first}" property="${field.filedName?uncap_first}" />
      </#list>
  </resultMap>
  <sql id="Base_Column_List">
      <#list entry["javaFieldInfos"] as field>`${field.columnName?uncap_first}`<#if field_has_next>,</#if></#list>
  </sql>
  <select id="page" resultMap="BaseResultMap">
    select <include refid="Base_Column_List"></include> from ${entry.tableName} where deleted = 0
      <#list entry["javaFieldInfos"] as field>
        <if test="queryForm.${field.filedName?uncap_first}!=null">
          and `${field.columnName?uncap_first}` =<#noparse>#{</#noparse>queryForm.${field.filedName?uncap_first}<#noparse>}</#noparse>
       </if>
      </#list>
  </select>
  <select id="list" resultMap="BaseResultMap">
    select <include refid="Base_Column_List"></include> from ${entry.tableName} where deleted = 0
      <#list entry["javaFieldInfos"] as field>
        <if test="queryForm.${field.filedName?uncap_first}!=null">
          and `${field.columnName?uncap_first}` =<#noparse>#{</#noparse>queryForm.${field.filedName?uncap_first}<#noparse>}</#noparse>
        </if>
      </#list>
  </select>

</mapper>
